#include "FoGGEDEF.h"
#include "aWidget.h"
#include ".\foggeuihelper.h"

namespace _FOGGE_
{
	namespace _UTIL_
	{
		namespace _HELPER_
		{
			::_FOGGE_::_UI_::Operation * LoadOperation(TiXmlNode* ptrNodeEH)
			{
				TiXmlElement * elmNodeEH=ptrNodeEH->ToElement();
				::_FOGGE_::_UI_::Operation *newOpp=foNEW ::_FOGGE_::_UI_::Operation;

				newOpp->m_Command=elmNodeEH->Attribute("command");
				newOpp->m_Receiver=elmNodeEH->Attribute("receiver");
				const char* temp=elmNodeEH->Attribute("parameters");
				if(temp)
				{
					foString temp2=temp;
					int index1=temp2.find_first_of("(");
					int index2=temp2.find_first_of(")");
					newOpp->m_Parameter=temp2.substr(index1+1,index2-(index1+1));
				}

				return newOpp;

			}
		}

	}
}
